<template>
    <div class="box">
        <h1>入学成绩查询</h1>
        <div class="tent">
            <div class="text">
                <div>
                    <input type="text" placeholder="请输入学号" v-model="stu_id">
                    <button @click="test">查询</button>
                </div>
                <label>姓名：<input type="text" v-model="stu_name" /></label><br />
                <label>语文：<input type="text" v-model="chinese" /></label><br />
                <label>数学：<input type="text" v-model="math" /></label><br />
                <label>英语：<input type="text" v-model="english" /></label><br />
                <label>理综：<input type="text" v-model="lizong" /></label><br />
                <label>文综：<input type="text" v-model="wenzong" /></label><br>
            </div>
        </div>
    </div>
</template>

<script>
import request from '../../api/request';
export default {
    data() {
        return {
            stu_id: '',
            stu_name: "",
            chinese: 0,
            math: 0,
            english: 0,
            lizong: 0,
            wenzong: 0,
        }
    },
    methods: {
        async test() {
            let stult = await request({method:'get',url: `search_entry/${this.stu_id}`, arg:{}, headerType:''});
            this.stu_name = stult.data[0].stu_name;
            this.chinese = stult.data[0].chinese;
            this.math = stult.data[0].math;
            this.english = stult.data[0].english;
            this.lizong = stult.data[0].lizong;
            this.wenzong = stult.data[0].wenzong;
        }
    }
}
</script>

<style lang="scss" scoped>
.box {
    display: flex;
    flex-direction: column;
    align-items: center;

    .tent {
        width: 600px;
        height: 500px;
        border: 1px solid black;
        display: flex;
        justify-content: center;
        align-items: center;
        .text{
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            div{
                margin-bottom: 20px;
            }
        }
    }
}
</style>